import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooMinishopGoodsServiceController } from '../../../controllers';
const uctoominishopGoodsServiceRouter = new Router();
const minishopGoodsServiceController = new uctooMinishopGoodsServiceController();

uctoominishopGoodsServiceRouter.post('/add', requireUser, minishopGoodsServiceController.add);
uctoominishopGoodsServiceRouter.post('/edit', requireUser, rowLevelPermission('uctoo/minishop_goods_service'), minishopGoodsServiceController.edit);
uctoominishopGoodsServiceRouter.post('/del', requireUser, rowLevelPermission('uctoo/minishop_goods_service'), minishopGoodsServiceController.delete);

//For getting minishopGoodsService with permission control
uctoominishopGoodsServiceRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/minishop_goods_service'), minishopGoodsServiceController.getSingle);
uctoominishopGoodsServiceRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/minishop_goods_service'), minishopGoodsServiceController.getMany);
uctoominishopGoodsServiceRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/minishop_goods_service'), minishopGoodsServiceController.getMany);

//#endregion AutoCreateCode
export default uctoominishopGoodsServiceRouter;
